﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using Microsoft.Dss.Core.Attributes;
using Microsoft.Robotics.Services.DepthCamSensor;
using NestedParticleFilter;

namespace iCreateSimulation
{
    /// <summary>
    /// iCreateSimulation state
    /// </summary>
    [DataContract]
    public class iCreateSimulationState
    {
        private RobotPose _patPose;
        private RobotPose _matPose;
        private bool _patBumperPressed;
        private bool _matBumperPressed;
        private DateTime _currentKinectReading;
        private DateTime _previousKinectReading;
        private DateTime _lastPressed;
        private Bitmap _kinectBitmap;

        private DateTime _lastTimeQueued;
        private DateTime _startDriveTime;
        private DateTime _stopDriveTime;

        private int _prevLeftWheelVelocity; // mm/sec
        private int _prevRightWheelVelocity; // mm/sec
        public Bitmap PatWebcamImage { set; get; }

        public DepthCamSensorState DepthState { set; get; }
        public double ObservedDepth { set; get; } // in mm
        public double ObservedAngle { set; get; }  // in degree
        public CustomisedColor ObservedColor { set; get; } // customized RGB color. Average of rgb values observed

        /// <summary>
        /// Default Constructor
        /// </summary>
        public iCreateSimulationState()
        {
            _matBumperPressed = false;
            _patBumperPressed = false;
            _lastPressed = DateTime.UtcNow;
            _previousKinectReading = DateTime.UtcNow;
            _lastTimeQueued = DateTime.UtcNow;
            _prevRightWheelVelocity = -1;
            _prevLeftWheelVelocity = -1;
            _lastTimeQueued = DateTime.UtcNow;

        }

        public RobotPose PatPose
        {
            set { _patPose = value; }
            get { return _patPose; }
        }
        public RobotPose MatPose
        {
            set { _matPose = value; }
            get { return _matPose; }
        }
        public bool PatBumperPressed
        {
            set { _patBumperPressed = value; }
            get { return _patBumperPressed; }
        }
        public bool MatBumperPressed
        {
            set { _matBumperPressed = value; }
            get { return _matBumperPressed; }
        }

        public DateTime LastPressed
        {
            set { _lastPressed = value; }
            get { return _lastPressed; }
        }
        public Bitmap KinectBitmap
        {
            set { _kinectBitmap = value; }
            get { return _kinectBitmap; }
        }

        public DateTime CurrentKinectReading
        {
            set { _currentKinectReading = value; }
            get { return _currentKinectReading; }
        }
        public DateTime PreviousKinectReading
        {
            set { _previousKinectReading = value; }
            get { return _previousKinectReading; }
        }
        public DateTime LastTimeQueued
        {
            set { _lastTimeQueued = value; }
            get { return _lastTimeQueued; }
        }

        public DateTime StartDriveTime
        {
            set { _startDriveTime = value; }
            get { return _startDriveTime; }
        }
        public DateTime StopDriveTime
        {
            set { _stopDriveTime = value; }
            get { return _stopDriveTime; }
        }
        public int PrevLeftWheelVelocity
        {
            set { _prevLeftWheelVelocity = value; }
            get { return _prevLeftWheelVelocity; }
        }
        public int PrevRightWheelVelocity
        {
            set { _prevRightWheelVelocity = value; }
            get { return _prevRightWheelVelocity; }
        }

        //private RobotPose _ubooPose;
        //private RobotPose _utooPose;

        //public RobotPose UbooPose
        //{
        //    set { _ubooPose = value; }
        //    get { return _ubooPose; }
        //}
        //public RobotPose UtooPose
        //{
        //    set { _utooPose = value; }
        //    get { return _utooPose; }
        //}

    }
}

